package com.tscnd.core.service.user.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tscnd.core.annotation.LogWrite;
import com.tscnd.core.dao.user.IUserDao;
import com.tscnd.core.entity.user.User;
import com.tscnd.core.exception.TSException;
import com.tscnd.core.service.user.IUserService;

@Service("userService")
public class UserServiceImpl implements IUserService {

	@Autowired
	private IUserDao userDao;

	@Override
	@LogWrite(desc = "ssss", modeName = "gggg")
	public void save() throws TSException
	{

	}

	@Override
	public User findByUsersLogin(String username) throws TSException
	{
		try
		{
			return userDao.findByUsersLogin(username);

		} catch (Exception e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
			throw new TSException("根据用户名查询用户信息失败\r\n" + e.getMessage());
		}
	}

	/**
	 * 登录成功后发生 通过注解方式记录登录成功日志
	 * 
	 * @see [类、类#方法、类#成员]
	 */
	@LogWrite(desc = "登录成功", modeName = "用户")
	public void LoginSuccess() throws TSException
	{

	}

	/**
	 * 
	 * 退出登录后发生，通过注解方式记录登录失败日志
	 * 
	 * @see [类、类#方法、类#成员]
	 */
	@LogWrite(desc = "退出系统", modeName = "用户")
	public void LogOut() throws TSException
	{

	}

}
